﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DXApplicationTangche.UC.货号管理.service;

namespace DXApplicationTangche.UC.货号管理
{
    public partial class Form查询标准款设计点 : DevExpress.XtraEditors.XtraForm
    {
        public Form查询标准款设计点(String saleStyleCode)
        {
            InitializeComponent();
            this.gridControl外观设计点.DataSource = new Model款式设计(saleStyleCode).craftDesignStyleRelationDTOs;
            this.gridControl工艺设计点.DataSource = 款式迭代Service.getCraftDesignBySaleStyleCode(saleStyleCode).Values;
        }
    }
    public class Model款式设计
    {
        public List<CraftDesignStyleRelationDTO> craftDesignStyleRelationDTOs { get; set; } = new List<CraftDesignStyleRelationDTO>();
        public Model款式设计(String saleStyleCode)
        {
            Dictionary<String, List<CraftDesignStyleRelationDTO>> keyValuePairs外观 =  款式迭代Service.getCraftDesignStyleRelationGroupBySaleStyleCode(saleStyleCode);
            foreach (KeyValuePair<String, List<CraftDesignStyleRelationDTO>> keyValuePair in keyValuePairs外观)
            {
                craftDesignStyleRelationDTOs.AddRange(keyValuePair.Value);
            }
        }
    }
}